package com.qianyitian.hope2.analyzer.util;

import java.util.List;

public class ProfitUtil {


    public static double sameCost(List<Number> numbers) {
        double totalAmout = numbers.stream().mapToDouble(n -> {
            return 1.0d / n.doubleValue();
        }).sum();
        double totalCost = numbers.size();
        return totalCost / totalAmout;
    }

    public static double sameAmount(List<Number> numbers) {
        double totalCost = numbers.stream().mapToDouble(Number::doubleValue).average().getAsDouble();
        return totalCost;
    }

}
